package com.rc.saas.mini.service.elec;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.mini.mapper.enterprise.EnterpriseSubmemberMapper;
import com.rc.saas.mini.model.enterprise.EnterpriseMember;
import com.rc.saas.mini.model.enterprise.EnterpriseSubmember;
import com.rc.saas.mini.model.member.MemberInfo;
import com.rc.saas.mini.vo.enterprise.EnterpriseSubmemberVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangzhengwei
 * @create 2021/12/18
 */
@Service
public class EnterpriseSubmemberServiceImpl implements EnterpriseSubmemberService {

    @Autowired
    private EnterpriseSubmemberMapper enterpriseSubmemberMapper;

    @Override
    public EnterpriseSubmemberMapper getMapper() {
        return enterpriseSubmemberMapper;
    }

    @Override
    public PageInfo<EnterpriseSubmemberVo> listPageSubMemberByEntMember(EnterpriseMember enterpriseMember, String keyword, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        List<EnterpriseSubmemberVo> list = enterpriseSubmemberMapper.listSubMemberByEntMember(enterpriseMember.getEnterpriseId(), keyword);
        return new PageInfo<>(list);
    }
}
